#pragma once
#include <map>
#include "Singleton.h"

class BasePlayer;

/*
	EntityManager is a dictionary of every entities of the application.
	Entity must be inserted using RegisterEntity() method.
	Once an entity is registered, you can get a pointer to that entity by entity's ID.
*/
class PlayerManager : public Singleton<PlayerManager>
{

public:
	//New entry to EntityMap. Key is the entity ID.
	void RegisterEntity(BasePlayer* player);

	//Return a pointer to the BaseEntity with the given ID
	BasePlayer* const GetEntityByID(int id) const;

	//Remove entity from EntityMap
	void RemoveEntity(BasePlayer* player);

private:
	typedef std::map<int, BasePlayer*> PlayerMap;
	PlayerMap m_playerMap;

};
	


